<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客详情页</title>

    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/detail.css">

</head>
<body>
    <div class="nav">
        <img src="pic/sign.jpg" alt="">
        <span class="blog-title">生菜虾的博客系统</span>
        <div class="space">
        </div>
        <a class="nav-span" href = "blog_list.html">主页</a>
        <a class="nav-span" href = "blog_edit.html">写博客</a>
        <a class="nav-span" href="logout">注销</a>
    </div>

    <div class="container">
        <div class="left">
            <div class="card">
                <img src="pic/head.jpg" alt="">
                <h3></h3>
                <a href="#">GitHub 地址</a>
                <div class="row">
                    <span>文章</span>
                    <span>分类</span>
                </div>
                <div class="row">
                    <span class="num"></span>
                    <span>1</span>
                </div>
            </div>
        </div>
        <div class="right">
            <div class="content">
                <div class="title"></div>
                <div class="date"></div>
                <div class="detail" id ="content">
                </div>
            </div>
        </div>
    </div>
    <script src="js/jquery.min.js"></script>
    <script src="blog-editormd/lib/marked.min.js"></script>
    <script src="blog-editormd/lib/prettify.min.js"></script>
    <script src="blog-editormd/editormd.js"></script>
    <script src="js/common.js"></script>
    <script>
        //获取博客详细信息
        $.ajax({
            type:"get",
            //location.search:?bolgId=1
            url:"blog"+location.search,
            success:function(blog){
                console.log(blog);
                document.querySelector(".content .title").innerHTML = blog.title;
                document.querySelector(".content .date").innerHTML = blog.createTime;
                // document.querySelector(".content .detail").innerHTML = blog.content;
                //通过markdown 来进行页面的渲染
                editormd.markdownToHTML("content", {
                        markdown: blog.content
                });
            }
        });
        //获取用户登录信息
        getUserInfo("detail");
    </script>
</body>
</html>